<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace plugins\wxapp_broadcast\model;

use app\admin\model\RouteModel;
use think\Model;
use think\Db;
use think\db\Query;

class WxappBroadcastRoomModel extends Model
{
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = true;

    /**
     * 关联 room表
     * @return $this
     */
    public function room()
    {
        return $this->belongsTo('');
    }

    /**
     * 列表
     */
    public function all()
    {
        $rooms = $this->order("id DESC")
            ->where('status', 1)
            ->where(function (Query $query) {
                
            })
            ->select()->toArray();

        return $rooms;
    }

    public function add($data)
    {
        $this->save($data);

        return $this;
    }

    public function del($room_id)
    {
        
    }
}